<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>机动车基本信息查询</title>
  <link rel="stylesheet" type="text/css" href="${ctx}/easyui/themes/default/easyui.css">
  <link rel="stylesheet" type="text/css" href="${ctx}/easyui/easyui_my.css">
  <link rel="stylesheet" type="text/css" href="${ctx}/easyui/themes/icon.css">
  <link rel="stylesheet" type="text/css" href="${ctx}/css/css.css" />

  <script type="text/javascript" src="${ctx}/js/jquery-1.7.min.js"></script>
  <script type="text/javascript" src="${ctx}/easyui/jquery.easyui.min.js"></script>
  <script type="text/javascript" src="${ctx }/easyui/locale/easyui-lang-zh_CN.js"></script>
  <script type="text/javascript" src="${ctx}/js/common.js"></script>

  <!--[if lte IE 6]>
  <script src="${ctx }/js/DD_belatedPNG_0.0.8a.js" type="text/javascript"></script>
  <script type="text/javascript">
    DD_belatedPNG.fix('.shequliuyang,.jjxinxi,ul, img, li, input , a, .png_bg');
    /* 将 .png_bg 改成你应用了透明PNG的CSS选择器*/
  </script>
  <![endif]-->
</head>
<body class="easyui-layout" options="border:false">
<div data-options="region:'north',height:104,border:false" style="padding-left:10px;padding-right: 10px;padding-top: 5px;">
  <div class="xinxichaxunkuangz1">
    <div class="dashujtiaojianxuanxiangkuan">
      <div class="dashujtiaojianxuanxiangkuan_lie">
        <div class="tiaojian_key">号牌号码：</div>
        <div class="tiaojian_values" style="width:1000px">
          <ul class="tiaojian_values_limian">
            <li>
               <!-- <input id="hphmSelect" name="hphmSelect" style="width: 65px;"/>- --><input id="hphm1Select" name="hphm1Select" type="text" class="shurukuangkais" style="float: none;width: 140px" value="皖"/>
            </li>
            <li><span class="buchongdbiaotdsw">车辆类型：</span>
              <input id="cllxSelect" name="cllxSelect" class="shurukuangkais" style="width: 150px;"/>
            </li>
            <li><span class="buchongdbiaotdsw">身份证明号码：</span>
              <input id="sfzmhmSelect" name="sfzmhmSelect" type="text" style="width: 150px;" class="shurukuangkais" value="请输入身份证号码" onblur="InputBlur('sfzmhmSelect','请输入身份证号码')" onfocus="InputFocus('sfzmhmSelect','请输入身份证号码')" />
            </li>
          </ul>
        </div>
      </div>
      <div class="dashujtiaojianxuanxiangkuan_lie">
        <div class="tiaojian_key">号牌种类：</div>
        <div class="tiaojian_values">
          <ul class="tiaojian_values_limian">
            <li>
              <input id="hpzlSelect" name="hpzlSelect" style="width: 152px"/>
            </li>
            <li><span class="buchongdbiaotdsw">初次登记日期：</span>
              <input id="ccdjrqSelect" type="text" name="ccdjrqSelect" style="width: 150px;" class="easyui-datebox"  data-options="editable:true"/>
            </li>
            <li><span class="buchongdbiaotdsw">&nbsp;&nbsp;&nbsp;精确查询：</span>
              <span style="height: 24px;line-height: 24px;">
                <input id="sltbz" name="sltbz" type="checkbox" checked="checked" />
              </span>
            </li>
          </ul>
        </div>
      </div>
      <div class="chaxunchongzhianniu">
        <a href="javascript:queryDataGrid()" class="congzhim">查询</a>
      </div>
    </div>
  </div>
</div>
<div data-options="region:'center',border:false" style="padding-left:10px;padding-right: 10px">
  <div class="easyui-layout xinxichaxunkuangz2" data-options="fit:true,border:false">
    <div class="tupianqiehuantop" data-options="region:'north',border:false" style="height: 40px">
      <span class="chaxunjieguosd">搜索结果</span>
    </div>
    <div data-options="region:'center',border:false">
      <table id="TableData" data-options="fit:true"></table>
    </div>
    <div id="SaveOrUpdateDevWin"
         style="width: 800px; height: 480px;"
         class="easyui-dialog" title=" "
         data-options="modal:true,closed:true,minimizable:false,collapsible:false,maximizable:false,buttons:'#bb',
         iconCls:'icon-save',onClose:function(){$('#saveOrUpdateDevForm')[0].reset();} ">
    </div>
    <%-- <div id="bb" >
      <a href="javascript:updateDev()" class="easyui-linkbutton" >导出当前表格</a>
      <a href="javascript:cancelUpdateDev()" class="easyui-linkbutton" >取消</a>
    </div> --%>
</div>
<script type="text/javascript">
  var jdcxh;
  function updateDev(){
    var url='${ctx}/export/JdcExcleDownload.htm?xh='+jdcxh;
    window.location.href=url;
  }
var jdcxxList;
  $(function(){
    initTable();
    //初始化车辆类型下拉框
    $.ajax({
      type:'POST',
      url:'${ctx}/code/findCodeByCodetype.htm',
      data:{
        dmlb:'1004',//机动车车辆类型代码
        xtlb:'00'
      },
      dataType:'json',
      success:function(data, textStatus, jqXHR){
        data.unshift({//在data首部添加一个元素
          'dmz':'',
          'dmsm1':'--车辆类型--'
        });
        $("#cllxSelect").combobox({
          valueField: 'dmz'
          ,textField: 'dmsm1'
          ,data:data
        });
      }
    });
    //初始化号牌号码下拉框
  /*   $.ajax({
      type:'POST',
      url:'${ctx}/code/findCodeByCodetype.htm',
      data:{
        dmlb:'0234',//车牌号对应城市
        xtlb:'00',
        dmsm3:'34'
      },
      dataType:'json',
      success:function(data, textStatus, jqXHR){
        data.unshift({//在data首部添加一个元素
          'hp':'',
          'hphm':'--城市--'
        });
        $("#hphmSelect").combobox({
          valueField: 'hp'
          ,textField: 'hphm'
          ,data:data
        });
      }
    }); */
    //初始化号牌种类下拉框
    $.ajax({
      type:'POST',
      url:'${ctx}/code/findCodeByCodetype.htm',
      data:{
        dmlb:'1007',//机动车号牌种类代码
        xtlb:'00'
      },
      dataType:'json',
      success:function(data, textStatus, jqXHR){
        data.unshift({//在data首部添加一个元素
          'dmz':'',
          'dmsm1':'--号牌种类--'
        });
        $("#hpzlSelect").combobox({
          valueField: 'dmz'
          ,textField: 'dmsm1'
          ,data:data
        });
      }
    });
  });
  //数据表
  function initTable(){
    $("#TableData").datagrid({
      url:'${ctx}/vehicleinfo/findJdcxx.htm',
      idField:'xh',
      fitColumns:true,
      border:false,
      singleSelect:true,
      pagination: true,
      pageSize: 10,                //每页记录数
      pageList: [5, 10, 15, 20, 30, 50], //分页记录数数组
// 				queryParams:{
// 					pageSize:10
// 					,page:1
// 				},
      columns:[[
        //{field:'',checkbox:true,align:'center',split:true},
        {field:'hphmStr',title:'号牌号码',width:'80',align:'center',split:true},
        {field:'hpzl',title:'号牌种类',width:'80',align:'center',split:true},
        {field:'clpp1',title:'中文品牌',width:'120',align:'center',split:true},
        {field:'clxh',title:'车辆型号',width:'130',align:'center',split:true},
        {field:'clsbdh',title:'车辆识别编号',width:'200',align:'center',split:true},
        {field:'cllx',title:'车辆类型',width:'100',align:'center',split:true},
        {field:'csys',title:'车身颜色',width:'60',align:'center',split:true},
        {field:'syr',title:'机动车所有人',width:'230',align:'center',split:true},
        {field:'sfzmhm',title:'身份证明号码',width:'130',align:'center',split:true},
        {field:'cz',title:'操作',width:'100',align:'center',split:true,fixed:true,formatter:function(value,row,index){
	  		return "<a class=\"chense\" href=\"javascript:CheckInfo('"+row.xh+"')\" >详情</a>";
	  	}}
      ]],
      onDblClickRow: function (rowIndex, rowData) {
        jdcxh=rowData.xh;
        CheckInfo(rowData.xh);
      }
    });
  }
  //根据界面中的样件，过滤查询机动车基本信息列表
  function queryDataGrid(){
    var hphm1Select = $("#hphm1Select").val() == null ? "":$("#hphm1Select").val().toUpperCase();
	var reg = /[\u4e00-\u9fa5]/g;//筛选是否有中文
    hphm = hphm1Select.replace(reg, "");
   // var hphmSelect = $("#hphmSelect").combobox('getValue');
    //var hphm = hphmSelect+hphm1Select;
    var sfzmhmSelect = $("#sfzmhmSelect").val() == "请输入身份证号码" ? "":$("#sfzmhmSelect").val();
    var cllxSelect = $("#cllxSelect").combobox('getValue');
    var hpzlSelect = $("#hpzlSelect").combobox('getValue');
    var ccdjrqSelect = $("#ccdjrqSelect").combobox('getValue');
    var sltbz = $("#sltbz").attr("checked") == "checked" ? "1" : "";//是否是精确查询
      $("#TableData").datagrid("load",{
        hphm:hphm
        ,cllx:cllxSelect
        ,sfzmhm:sfzmhmSelect
        ,hpzl:hpzlSelect
        ,str:ccdjrqSelect
        ,sltbz:sltbz
      });
  }
  function CheckInfo(xh){
    $('#saveOrUpdateDevForm').form('clear');
    $('#SaveOrUpdateDevWin').window('open');
    var ss="<iframe id=\"aaa\" frameborder=\"0\" style=\"width:100%;height:99%;\" src=\""+'${ctx}/vehicleinfo/findJdcxxByXh.htm?xh='+xh+"\" scrolling=\"no\"/>";
    $("#SaveOrUpdateDevWin").html(ss);
  }
</script>
</body>
</html>